package com.meeting.utils;

public class UserContext {
    private static final ThreadLocal<Integer> currentUserId = new ThreadLocal<>();
    private static final ThreadLocal<String> currentUserRole = new ThreadLocal<>();

    public static void setId(int id){
        currentUserId.set(id);
    }

    public static int getId(){
        return currentUserId.get();
    }

    public static void setRole(String role){
        currentUserRole.set(role);
    }

    public static String getRole() {
        return currentUserRole.get();
    }

    public static void clear(){
        currentUserId.remove();
        currentUserRole.remove();
    }
}
